
#ifndef MYHACK_H
#define MYHACK_H
/**
 * File with a whole bunch of struct definitions tossed together, just
 * to make it compile.
 */
#define IP_RF 0x8000
#define IP_DF 0x4000
#define IP_MF 0x2000
#define IP_OFFMASK 0x1fff

struct ip
{
    u_short ip_hl_v_tos;
//     unsigned int ip_hl:4;
//     unsigned int ip_v:4;
//     unsigned char ip_tos;
    u_short ip_len;
    u_short ip_id;
    u_short ip_off;
    unsigned char ip_ttl;
    unsigned char ip_p;
    u_short ip_sum;
    struct in_addr ip_src, ip_dst;
};


#define ETH_ALEN 6    // Octets in one ethernet addr.
#define ETH_P_IP 0x0800  // IP packet

struct ethhdr
{
    unsigned char h_dest[ETH_ALEN];
    unsigned char h_source[ETH_ALEN];
    unsigned short h_proto;
};

#define ether_header ethhdr
#define ether_type h_proto
#define ETHERTYPE_IP ETH_P_IP

typedef u_int32_t tcp_seq;

#  define TH_FIN        0x01
#  define TH_SYN        0x02
#  define TH_RST        0x04
#  define TH_PUSH       0x08
#  define TH_ACK        0x10
#  define TH_URG        0x20


struct tcphdr
{
    u_int16_t th_sport;         /* source port */
    u_int16_t th_dport;         /* destination port */
    tcp_seq th_seq;             /* sequence number */
    tcp_seq th_ack;             /* acknowledgement number */
// #  if __BYTE_ORDER == __LITTLE_ENDIAN

    unsigned char th_x2_off;

//     unsigned char th_x2:4;           /* (unused) */
//     unsigned char th_off:4;          /* data offset */


// #  endif
// #  if __BYTE_ORDER == __BIG_ENDIAN
//     u_int8_t th_off:4;          /* data offset */
//     u_int8_t th_x2:4;           /* (unused) */
// #  endif
    unsigned char th_flags;
    u_int16_t th_win;           /* window */
    u_int16_t th_sum;           /* checksum */
    u_int16_t th_urp;           /* urgent pointer */
};

     



#endif

